Thu Jun 19 17:04:53 2025
# cell chat results per condition
cellchat <- readRDS(params$cellchat_file)
groupSize <- as.numeric(table(cellchat$Untreated@idents))
netVisual_circle(cellchat$Untreated@net$weight, vertex.weight = groupSize,
weight.scale = T, label.edge= F, title.name = "Interaction weights/strength",
vertex.label.cex = 1)
pdf(file = 'untreated.pdf', width = 10, height = 10)
netVisual_circle(cellchat$Untreated@net$weight, vertex.weight = groupSize,
weight.scale = T, label.edge= F, title.name = "Interaction weights/strength",
vertex.label.cex = 3.2, edge.width.max = 15)
dev.off()
## png
## 2
groupSize <- as.numeric(table(cellchat$DSS@idents))
netVisual_circle(cellchat$DSS@net$weight, vertex.weight = groupSize,
weight.scale = T, label.edge= F, title.name = "Interaction weights/strength")
pdf(file = 'DSS.pdf', width = 10, height = 10)
netVisual_circle(cellchat$DSS@net$weight, vertex.weight = groupSize,
weight.scale = T, label.edge= F, title.name = "Interaction weights/strength",
vertex.label.cex = 3.2, edge.width.max = 15)
dev.off()
## png
## 2
groupSize <- as.numeric(table(cellchat$Recovery@idents))
pdf(file = 'recovery.pdf', width = 10, height = 10)
netVisual_circle(cellchat$Recovery@net$weight, vertex.weight = groupSize,
weight.scale = T, label.edge= F, title.name = "Interaction weights/strength",
vertex.label.cex = 3.2, edge.width.max = 15)
dev.off()
## png
## 2
netVisual_heatmap(cellchat$Untreated, color.heatmap = "Reds", measure = 'weight')
netVisual_heatmap(cellchat$DSS, color.heatmap = "Reds", measure = 'weight')
netVisual_heatmap(cellchat$Recovery, color.heatmap = "Reds", measure = 'weight')
obj <- cellchat$Untreated
paths <- obj@netP$pathways
netAnalysis_contribution(obj, signaling = paths)
obj <- cellchat$DSS
paths <- obj@netP$pathways
netAnalysis_contribution(obj, signaling = paths)
obj <- cellchat$Recovery
paths <- obj@netP$pathways
netAnalysis_contribution(obj, signaling = paths)
obj <- cellchat$Untreated
netVisual_chord_gene(obj, slot.name = "netP", legend.pos.x = 10, lab.cex = 0.4)
obj <- cellchat$DSS
netVisual_chord_gene(obj, slot.name = "netP", legend.pos.x = 10, lab.cex = 0.4)
obj <- cellchat$Recovery
netVisual_chord_gene(obj, slot.name = "netP", legend.pos.x = 10, lab.cex = 0.4)
## png
## 2
## png
## 2
cellchat <- sapply(simplify = F, cellchat, function(obj) {
netAnalysis_computeCentrality(obj, slot.name = "netP")
})
obj <- cellchat$Untreated
netAnalysis_signalingRole_heatmap(obj, pattern = "outgoing", color.heatmap = 'Reds',
height = 15, width = 20)
obj <- cellchat$DSS
netAnalysis_signalingRole_heatmap(obj, pattern = "outgoing", color.heatmap = 'Reds',
height = 15, width = 20)
obj <- cellchat$Recovery
netAnalysis_signalingRole_heatmap(obj, pattern = "outgoing", color.heatmap = 'Reds',
height = 15, width = 20)
obj <- cellchat$Untreated
netAnalysis_signalingRole_heatmap(obj, pattern = "incoming", color.heatmap = 'Reds',
height = 15, width = 20)
obj <- cellchat$DSS
netAnalysis_signalingRole_heatmap(obj, pattern = "incoming", color.heatmap = 'Reds',
height = 15, width = 20)
obj <- cellchat$Recovery
netAnalysis_signalingRole_heatmap(obj, pattern = "incoming", color.heatmap = 'Reds',
height = 15, width = 20)
nPatterns = 4
cellchat <- sapply(simplify = F, cellchat, function(obj) {
identifyCommunicationPatterns(obj, pattern = "incoming", k = nPatterns, heatmap.show = F)
})
obj <- cellchat$Untreated
netAnalysis_river(obj, pattern = "incoming")
obj <- cellchat$DSS
netAnalysis_river(obj, pattern = "incoming")
obj <- cellchat$Recovery
netAnalysis_river(obj, pattern = "incoming")
nPatterns = 4
cellchat <- sapply(simplify = F, cellchat, function(obj) {
identifyCommunicationPatterns(obj, pattern = "outgoing", k = nPatterns, heatmap.show = F)
})
obj <- cellchat$Untreated
netAnalysis_river(obj, pattern = "outgoing")
obj <- cellchat$DSS
netAnalysis_river(obj, pattern = "outgoing")
obj <- cellchat$Recovery
netAnalysis_river(obj, pattern = "outgoing")